package it.eng.ws.test.stateAction;

import com.airline.www.AirlineReservation;
import com.airline.www.SequenceNumberGenerator;

import it.eng.ws.test.automata.StateAction;
import it.eng.ws.test.exceptions.UAExecutionException;
import it.eng.ws.test.logging.SimpleLog;

public class ConfirmFlightReservation extends StateAction{


	@Override
	public void doAction() throws UAExecutionException {
		AirlineReservation port = (AirlineReservation)this.getSharedMemory().get("AirlineReservation");
		SequenceNumberGenerator sng = (SequenceNumberGenerator)this.getSharedMemory().get("sequence_number");
		long sn=sng.nextLong();
        long time=System.currentTimeMillis();
		port.checkFlights(sn, "luca.bianchi@gmail.com", "lucaBianchi");
		long time2=System.currentTimeMillis();
		SimpleLog.write("ConfirmFlightReservation | "+time+" | "+(time2-time)+" | ms | "+sn+ "| "+Thread.currentThread().hashCode());
	}

}
